/**
 * @projectName demo-master
 * @fileName ConfigController.java
 * @packageName org.example.nacos.config.controller
 * @author xaoyaoyao
 * @date 2021/3/23 13:57
 * @version V1.0
 * @copyright (c) 2021, xaoyaoyao@aliyun.com All Rights Reserved.
 */
package org.example.nacos.config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xaoyaoyao
 * @className ConfigController
 * @description
 * @date 2021/3/23 13:57
 */
@RestController
@RequestMapping("/config")
@RefreshScope
public class ConfigController {

	@Value("${useLocalCache:false}")
	private boolean useLocalCache;

	/**
	 * http://localhost:8080/config/get
	 */
	@RequestMapping("/get")
	public boolean get() {
		return useLocalCache;
	}
}
